#include "Wektor.h"

Wektor::Wektor(double x, double y, double z) {
    this->x = x;
    this->y = y;
    this->z = z;
}

Wektor::Wektor() {
    this->x = 0;
    this->y = 0;
    this->z = 0;
}

Wektor Wektor::operator*(double d) {
    Wektor r(this->x * d,this->y * d,this->z * d);
    return r;
}

Wektor Wektor::operator*(Wektor& w) {
    Wektor r(
            this->y * w.z - this->z * w.y, //brak x to OK
            this->z * w.x - this->x * w.z, //brak y to OK
            this->x * w.y - this->y * w.x  //brak z to OK
            );
    return r;
//return Point(y*B.z - z*B.y, z*B.x - x*B.z, x*B.y - y*B.x);
}

Wektor Wektor::operator+(Wektor w) {
    Wektor r(
            this->x + w.x,
            this->y + w.y,
            this->z + w.z
            );
    return r;

}

Wektor Wektor::operator-(Wektor w) {
    Wektor r(
            this->x - w.x,
            this->y - w.y,
            this->z - w.z
            );
    return r;
}

Wektor Wektor::operator/(double d) {
    Wektor r(
            this->x / d,
            this->y / d,
            this->z / d
            );
    return r;
}

void Wektor::operator/=(double d) {
    this->x /= d;
    this->y /= d;
    this->z /= d;

}
/*
std::iosrteam operator<<(std::iostream ios, Wektor w){
    ios<<"("<<w.X()<<"; "<<w.Y()<<"; "<<w.Z()<<")";

}*/

double Wektor::razy(Wektor& w){
   
    return (this->x * w.x + this->y * w.y + this->z * w.z );

}
